﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ctrl="http://schemas.xceed.com/silverlight/xaml/controls">

   <!--**************************
    * TEMPLATE: AutoSelectTextBoxEditor
    * ScrollViewer Name has to be "PART_ContentHost" in WPF, 
    * but "ContentElement" in Silverlight
    ************************** -->
   <ControlTemplate x:Key="SilverlightThemeAutoSelectTextBoxEditorTemplate"
                    TargetType="ctrl:AutoSelectTextBox">

      <Border x:Name="MouseOverBorder"
              BorderThickness="1"
              BorderBrush="Transparent">

         <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="CommonStates">
               <VisualState x:Name="Normal" />
               <VisualState x:Name="MouseOver">
                  <Storyboard>
                     <ColorAnimation Storyboard.TargetName="MouseOverBorder"
                                     Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
                                     To="#FF99C1E2"
                                     Duration="0" />
                  </Storyboard>
               </VisualState>
               <VisualState x:Name="Disabled">
                  <Storyboard>
                     <DoubleAnimation Storyboard.TargetName="MouseOverBorder"
                                      Storyboard.TargetProperty="Opacity"
                                      To="0.40"
                                      Duration="00:00:00.000" />
                  </Storyboard>
               </VisualState>
            </VisualStateGroup>
         </VisualStateManager.VisualStateGroups>

         <ScrollViewer x:Name="ContentElement"
                       Padding="{TemplateBinding Padding}"
                       BorderThickness="0"
                       IsTabStop="False" />
      </Border>

   </ControlTemplate>

   <!--**************************
    * TEMPLATE: NumericTextBoxEditor
    * ScrollViewer Name has to be "PART_ContentHost" in WPF, 
    * but "ContentElement" in Silverlight
    ************************** -->
   <ControlTemplate x:Key="SilverlightThemeNumericTextBoxEditorTemplate"
                    TargetType="ctrl:NumericTextBox">

      <Border x:Name="MouseOverBorder"
              BorderThickness="1"
              BorderBrush="Transparent">

         <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="CommonStates">
               <VisualState x:Name="Normal" />
               <VisualState x:Name="MouseOver">
                  <Storyboard>
                     <ColorAnimation Storyboard.TargetName="MouseOverBorder"
                                     Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
                                     To="#FF99C1E2"
                                     Duration="0" />
                  </Storyboard>
               </VisualState>
               <VisualState x:Name="Disabled">
                  <Storyboard>
                     <DoubleAnimation Storyboard.TargetName="MouseOverBorder"
                                      Storyboard.TargetProperty="Opacity"
                                      To="0.40"
                                      Duration="00:00:00.000" />
                  </Storyboard>
               </VisualState>
            </VisualStateGroup>
         </VisualStateManager.VisualStateGroups>

         <ScrollViewer x:Name="ContentElement"
                       Padding="{TemplateBinding Padding}"
                       BorderThickness="0"
                       IsTabStop="False" />
      </Border>

   </ControlTemplate>

   <!--**************************
    * TEMPLATE: WatermarkTextBoxEditor
    * ScrollViewer Name has to be "PART_ContentHost" in WPF, 
    * but "ContentElement" in Silverlight
    ************************** -->
   <ControlTemplate x:Key="SilverlightThemeGroupNavigationSearchBoxWaterMarkTemplate"
                    TargetType="TextBox">
      <Grid x:Name="RootElement">
         <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="CommonStates">
               <VisualState x:Name="Normal" />

               <VisualState x:Name="MouseOver" />

               <VisualState x:Name="Disabled">
                  <Storyboard>
                     <DoubleAnimation Duration="00:00:00.000"
                                      To="0.5"
                                      Storyboard.TargetProperty="(UIElement.Opacity)"
                                      Storyboard.TargetName="RootElement" />
                  </Storyboard>
               </VisualState>

               <VisualState x:Name="ReadOnly" />
            </VisualStateGroup>

            <VisualStateGroup x:Name="WatermarkStates">
               <VisualState x:Name="WatermarkVisible">
                  <Storyboard>
                     <DoubleAnimation Storyboard.TargetName="WatermarkPresenter"
                                      Storyboard.TargetProperty="Opacity"
                                      To="0.7"
                                      Duration="00:00:00.000" />
                  </Storyboard>
               </VisualState>

               <VisualState x:Name="WatermarkHidden">
                  <Storyboard>
                     <DoubleAnimation Storyboard.TargetName="WatermarkPresenter"
                                      Storyboard.TargetProperty="Opacity"
                                      To="0"
                                      Duration="00:00:00.000" />
                  </Storyboard>
               </VisualState>
            </VisualStateGroup>
         </VisualStateManager.VisualStateGroups>

         <Border x:Name="Border"
                 Opacity="1"
                 CornerRadius="10,0,0,10"
                 BorderThickness="1,1,0,1"
                 BorderBrush="#FFCFD0D0">
            <Border.Background>
               <LinearGradientBrush StartPoint="0.5,0"
                                    EndPoint="0.5,1">
                  <GradientStop Color="#FFD4D8DC"
                                Offset="0" />

                  <GradientStop Color="#FFECEDEF"
                                Offset="0.18" />

                  <GradientStop Color="#FFECF2F7"
                                Offset="1" />
               </LinearGradientBrush>
            </Border.Background>
         </Border>

         <Grid Margin="8,0,0,0"
               VerticalAlignment="Center">
            <ScrollViewer x:Name="ContentElement"
                          Foreground="White"
                          Padding="{TemplateBinding Padding}"
                          BorderThickness="0"
                          IsTabStop="False" />

            <ContentPresenter x:Name="WatermarkPresenter"
                              IsHitTestVisible="False"
                              Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=WatermarkContent, Mode=OneWay}"
                              ContentTemplate="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=WatermarkContentTemplate, Mode=OneWay}" />
         </Grid>
      </Grid>
   </ControlTemplate>

</ResourceDictionary>
